package top.buyibuyi.course.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.buyibuyi.course.R;
import top.buyibuyi.course.service.UpdateCourseStateService;

@RestController
@CrossOrigin
@RequestMapping("/course")
public class UpdateCourseStateController {

    @Autowired
    private UpdateCourseStateService updateCourseStateService;

    @GetMapping("/updateStateFb/{state}/{id}")
    public R updateStateFb(@PathVariable String state,@PathVariable int id){
        Boolean aBoolean = updateCourseStateService.updateState(state, id);
        return R.ok().data("data",aBoolean);
    }
}
